from selenium import webdriver
from selenium.webdriver.common.by import By

from base import Base


class Baidu_serch(Base):
    # 关联页面
    # 关联元素
    # 关联业务
    url = "https://www.baidu.com/"
    inputdiv = (By.ID, "kw")
    serch_button = (By.ID, "suu")
    def serch(self,txt,assdoc):
        self.get(self.url)
        self.input(self.inputdiv,txt,doc="输入")
        self.click(self.serch_button,doc="点击")
        self.assert_tool(assdoc,doc="百度搜索")


if __name__ == '__main__':
    driver = webdriver.Chrome()
    tt = Baidu_serch(driver)
    tt.serch()

